import { Request } from "express";

export function paginate(req: Request) {
  const page = req.query.page ? Number(req.query.page) : 1;
  const limit = req.query.limit ? Number(req.query.limit) : 10;
  return {
    skip: (page - 1) * limit,
    take: limit,
  };
}
